public class Data {
    public int year;
    public int month;
    public int day;
/*//有参数的构造方法
    public Data(int year, int month, int day){
        this.year = year;
        this.month = month;
        this.day = day;
    }*/
//无参数的构造方法 并且初始化
    public Data(){
       // this(2002,03,19);
        /*this.year = 2002;
        this.month = 03;
        this.day = 19;*/
    }

    public void Data(int year,int month,int day){
        this.year = year;
        this.month = month;
        this.day = day;
    }
    public void printData(){
        System.out.println(this.year+"年"+this.month+"月"+this.day+"日");
    }


    public static void main(String[] args) {
        //实例化有参数构造方法 并且初始化
        Data data = new Data();
        //实例化无参数的构造方法
       // Data data2 = new Data();

     data.printData();
        //data2.printData();
    }
}
